# 14.4 baseViewPath

The setting for baseViewPath has been moved from the configConstant(...) method to the Routes object, and it can be set separately for different Routes objects. Here's an example:

public class FrontRoutes extends Routes {
 
  public void config() {
    setBaseViewPath("/_view");
 
    add("/", IndexController.class, "/index");
    add("/project", ProjectController.class);
  }
}
1
2
3
4
5
6
7
8
9

The advantage of moving it from configConstant(...) to configRoute(...) is that you can set it differently for various Routes, reducing redundant code. Different modules may very likely have different baseViewPaths. The code example above is for cases where Routes have been broken down into smaller parts. If your application has not split the Routes, you can simply configure it in configRoute as follows:

public void configRoute(Routes me) {
   me.setBaseViewPath("/_view");
 
   me.add("/", IndexController.class);
}
1
2
3
4
5
Last Updated: 9/22/2023, 7:59:19 AM